-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explicitly ban overriding extend
as part of a --config flag
#10135
Conversation
crates/ruff/tests/lint.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also ban passing extend
as part of a --config
flag when doing ruff format
, but I didn't bother adding an equivalent test in crates/ruff/tests/format.rs
, as it just felt duplicative. Lmk if you disagree!
This is, in theory, a breaking change because it could break invocations like |
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
PLR0917 | 1 | 1 | 0 | 0 | 0 |
Formatter (stable)
ℹ️ ecosystem check encountered format errors. (no format changes; 1 project error)
openai/openai-cookbook (error)
warning: Detected debug build without --no-cache.
error: Failed to read examples/How_to_handle_rate_limits.ipynb: Expected a Jupyter Notebook, which must be internally stored as JSON, but this file isn't valid JSON: trailing comma at line 47 column 4
Formatter (preview)
ℹ️ ecosystem check encountered format errors. (no format changes; 1 project error)
openai/openai-cookbook (error)
ruff format --preview
warning: Detected debug build without --no-cache.
error: Failed to read examples/How_to_handle_rate_limits.ipynb: Expected a Jupyter Notebook, which must be internally stored as JSON, but this file isn't valid JSON: trailing comma at line 47 column 4
Summary
Relates to #10035. Attempting to override
extend
as part of a --config flag doesn't work because we currently apply the configuration overrides given in the--config
flag after any configuration options found in anypyproject.toml
/ruff.toml
files have been parsed and validated. But this particular override affects which config files ruff should be looking at in the first place, so we'd need to look for it at an earlier stage in the process.Currently we just silently accept the argument but just don't do anything with it; this PR changes that so that we explicitly error out if a user tries to override
extend
using the--config
flag. Longer term, we could possibly think about reworking how--config
works so that it is possible to overrideextend
using--config
; or, we could add a separate option so that people can overrideextend
properly via the command line.Test Plan
cargo test
, and manual testing